昨天跟今天介紹git,這篇會有比較深入的git操作
git checkout -b feature/memberA
:切換分支同時開新分支git add .
:添加變更到本地端git commit -m "輸入commit內容"
:提交變更到本地端git push origin feature/memberA
:將分支進行git push,並發PR合併到main,指派成員reviewgit fetch origin feature/memberB
:抓取夥伴的分支git checkout origin feature/memberB
:切換到夥伴的分支觀看頁面git pull origin main
:抓取最新版本下來並merge步驟到此結束,但此時若你還想編輯新東西
5. git fetch origin main
:抓取最新版本下來但不會merge
6. git checkout feature/memberA
:切換到自己的分支繼續修改
7. git add .
8. git commit -m "輸入commit內容"
9. git merge origin main
10. 發生衝突解決衝突
11. 重新add + commit
12. git push origin feature/memberA
:將分支進行git push,並發PR合併到main
git fetch origin main
:抓取最新版本下來git checkout origin main
:切換到main分支git checkout -b feature/newFunction
:切換到新的分支繼續開發git add .
git commit -m "輸入commit內容"
git push origin feature/newFunction
:將分支進行git push,並發PR合併到main